package com.yanqu.road.logic.pb;

import com.yanqu.road.entity.tradewar.UserCrossTradeWarTeam;
import com.yanqu.road.entity.tradewar.UserTradeWarTeam;
import com.yanqu.road.pb.tradewar.team.TradeWarTeamProto;

public class TradeWarTeamPb {
    public static TradeWarTeamProto.TradeWarTeamMsg.Builder parseTradeWarTeamMsg(UserTradeWarTeam userTradeWarTeam, UserCrossTradeWarTeam userCrossTradeWarTeam) {
        TradeWarTeamProto.TradeWarTeamMsg.Builder msg = TradeWarTeamProto.TradeWarTeamMsg.newBuilder();
        if (null != userTradeWarTeam) {
            msg.setTeamData(userTradeWarTeam.getPatronsTeamListString());
            msg.setTeamBuyBuffData(userTradeWarTeam.getBuyBuffTimesListString());
        } else {
            return null;
        }

        if (null != userCrossTradeWarTeam) {
            msg.setCrossTeamData(userCrossTradeWarTeam.getPatronsTeamListString());
            msg.setCrossTeamBuyBuffData(userCrossTradeWarTeam.getBuyBuffTimesListString());
        }

        return msg;
    }
}
